<?php
/**************************************************/
## @author: ALANKAR 
## Class Name - Model_NAB (Contains all the functions related to NAB settings )
## Created By - Techmodi (14/05/2012)
/**************************************************/

class Model_NAB extends Database 
{	
	## Constructor
	function Model_NAB() {
		$this->nab              = NAB;
		$this->Database();
	}	


## Getting all the details from the NAB details 
function getDetailsFromNAB(){
	$fields = array();
	$tables = array($this->nab);
	$res    = $this->SelectData($fields,$tables,$where =array(),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchAll($res);
	return $result;
	
}

function getDetail(){
	$fields = array();
	$tables = array($this->nab);
	$res    = $this->SelectData($fields,$tables,$where =array(),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchAll($res);
	return $result[0];
	
}

function getNextOrder()
{
	$sql = "select max(id) as mid from getbids_usermembership";
	$res = $this->ExecuteQuery($sql);
	$row = $this->FetchRow($res);
	return $row['mid'] + 1;
}


## Getting all the details from the NAB details 
function getDetailsFromNABById($NAB_Id){
	$fields = array();
	$tables = array($this->nab);
	$res    = $this->SelectData($fields,$tables,$where =array("id ='".$NAB_Id."'"),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchAll($res);
	return $result;
	
}
## Getting details from the NAB details 
function getDetailNABAccountById($NAB_Id){
	$fields = array();
	$tables = array($this->nab);
	$res    = $this->SelectData($fields,$tables,$where =array("id ='".$NAB_Id."'"),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchRow($res);
	return $result;
	
}

# updating details 
function UpdateNABDetails($array , $id){
	$this->UpdateData($this->nab,$array,"id",$id,0);
}
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/		
}

?>
